package com.heima.feigins;

import com.heima.config.HeimaFeiginAutoConfiguration;
import com.heima.feigins.fallback.ArticleFeiginFallback;
import com.heima.model.article.pojos.ApAuthor;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "leadnews-article",fallbackFactory= ArticleFeiginFallback.class,configuration = HeimaFeiginAutoConfiguration.class)
public interface ArticleFeigin {
    /*
     * 根据id查询作者信息
     * */
    @GetMapping("/api/v1/author/findByUserId/{id}")
    public ResponseResult<ApAuthor> findByUserId(@PathVariable("id") Integer userId);
    //作者信息保存
    /*
     * 根据id查询作者信息
     * */
    @PostMapping("/api/v1/author/save")
    public ResponseResult<ApAuthor> save(@RequestBody ApAuthor apAuthor);
}

